package jicheng;

public class Animal {

	private String name;
	private int age;
	
	
	/**
	 * 构造
	 */
	public Animal() {
		System.out.println("无参数构造方法");
	}
	
	/**
	 * 有参数构造
	 * @param name
	 * @param age
	 */
	public Animal(String name, int age) {
		System.out.println("有参构造方法");
		this.name = name;
		this.age = age;
	}

	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public int getAge() {
		return age;
	}
	public void setAge(int age) {
		this.age = age;
	}
	
	public void say(){
		System.out.println("我是一个动物，我叫："+name+",年龄："+age);
	}
}
